package cn.net.qinling.xmlaccess;

import java.util.List;

public class TestQuery {
	
	protected static void printResult(List<String> resultList) {
		/*
		for (String result : resultList) {
			System.out.println(result);
		}
		*/
		System.out.println(resultList.size());
	}
	
	private static void test(DataAccess da) throws Exception {
		System.out.println(da);
		List<String> resultList = null;
		Timer timer = new Timer();
		
		timer.startTiming("PPA");
		resultList = da.listRecordsByPatientPartialAddress("人民医院");
		timer.endTiming("PPA");
		printResult(resultList);
		
		timer.startTiming("QDI");
		resultList = da.listRecordsByPatientDemographyInfo("M", "常德市");
		timer.endTiming("QDI");
		printResult(resultList);
		
		timer.startTiming("QPI");
		resultList = da.listRecordsByPatientId("430707201212117010");
		timer.endTiming("QPI");
		printResult(resultList);
		
		
		
		
		System.out.println(timer);
	}

	public static void main(String[] args) {
		
		DataAccess da = null;
				
		try {
			da = new OracleDataAccess();
			test(da);
			da = new DB2DataAccess();
			test(da);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}

}
